<?PHP

	class tpl_roomcp {
		
		public static function printmenu($data,$section){
			
			$menu_html = '';
			foreach($data as $menu_header=>$menu_data){
				
				$menu_html .= "<div class='menu_container'><div class='menu_title'>$menu_header</div>";
				foreach($menu_data as $menu_item=>$menu_url){
					
					if($section != $menu_url){
						$classes = " class='menu_item_n' onmouseover=\"this.className='menu_item_o'\" onmouseout=\"this.className='menu_item_n'\"";
					}else{
						$classes = " class='menu_item_o'";
					}
					
					$menu_html .= "<div $classes onclick=\"document.location='./index.php?act=roomsettings{$GLOBALS['OUTPUT']->ses}&section=$menu_url&rid={$GLOBALS['OUTPUT']->rid}'\">$menu_item</div>";
				}
				$menu_html .= "</div><br />";
				
			}
			
			return<<<EOV
<style type='text/css'>
	.menu_container {
		border: 1px solid #909397;
		background: white;
		width: 195px;
		padding: 1px;
	}

	.menu_title {
		background: url(./themes/default/images/table_header_bg.png);
		height: 20px;
		font-weight: bold;
		font-size: 14px;
		padding: 5px;
		text-align: center;
	}

	.menu_item_n, .menu_item_o {
		background: #E2E7EA;
		border-top: 1px solid white;
		padding: 5px;
		cursor: pointer;
		color: #24517F;
	}

	.menu_item_o {
		background: #4091E4;
		color: white;
	}
</style>
$menu_html
EOV;
		}
		
		public static function header(){
			
			$menu = tpl_roomcp::printmenu($GLOBALS['OUTPUT']->cpmenu,$GLOBALS['OUTPUT']->cpsection);
			
			return <<<EOV
<div style='float: left; width: 197px; margin-right: 15px;'>
		{$menu}
</div>
<div style='float: left; width: 425px;'>
EOV;
		}
		
		/*
		public static function header(){
			
			$message = '';
			if(isset($GLOBALS['OUTPUT']->message)){
				$message = <<<EOV
<div class='table_header'>&nbsp;{$GLOBALS['LANG']->lang_roomcp->information}</div>
<div class='box_container'>
	<div class='infobox_inside'>{$GLOBALS['OUTPUT']->message}</div>
</div>
<br />
EOV;
			}
			
			$menu = '';
			foreach($GLOBALS['OUTPUT']->cpmenu as $label=>$action){
				if($action == 'header'){
					$menu .= "<div class='menu_header'>".$label."</div>";
				}else{
					$menu .= "<div class='".($GLOBALS['OUTPUT']->section == $label ? 'menu_item_active' : 'menu_item_norm')."' onmouseout=\"this.className=this.className.replace('_hover','_norm');\" onmouseover=\"this.className=this.className.replace('_norm','_hover');\" onclick=\"document.location='".$action.$GLOBALS['OUTPUT']->ses."&rid={$GLOBALS['OUTPUT']->rid}'\">".$label."</div>";
				}
			}
			
			return <<<EOV
<style type='text/css'>
	.menu_block {
		width: 200px;
		border: 1px solid #797b7f;
		border-top: 0px;
		float: left;
		margin-right: 8px;
	}

	.menu_item_norm, .menu_item_hover, .menu_item_active {
		background: url(./themes/default/images/dropdown_menu_bg.png);
		font-size: 12px;
		padding: 2px;
		padding-left: 20px;
		height: 16px;
		cursor: pointer;
		color: #24517F;
	}
	
	.menu_item_hover, .menu_item_active {
		background-position: 0px -21px;
		color: white;
	}
	
	.menu_header {
		border-top: 1px solid #797b7f;
		text-align: center;
		font-weight: bold;
		font-size: 12px;
		background: url(./themes/default/images/dropdown_menu_bg.png) #ccd1d7;
		background-position: 0px -42px;
		height: 16px;
		padding: 2px;
	}
</style>
<div style='float: left; width: 200px; margin-right: 15px;'>
	<div class='menu_block'>
		{$menu}
	</div>
</div>
<div style='float: left; width: 425px;'>
{$message}
EOV;
		}
*/		

		public static function footer(){
			return <<<EOV
</div>
EOV;
		}
		
		public static function voicelist(){
			
			$warning = ($GLOBALS['OUTPUT']->warning ? <<<EOV
<div class='table_header'>&nbsp;{$GLOBALS['LANG']->lang_roomcp->information}</div>
<div class='box_container'>
	<div class='infobox_inside'>{$GLOBALS['LANG']->lang_roomcp->voicelist_warning}</div>
</div>
<br />
EOV
: '');

			$intro_text = str_replace('<a>',"<a href='./index.php?act=roomsettings&section=voicectrls&rid={$GLOBALS['OUTPUT']->rid}{$GLOBALS['OUTPUT']->ses}'>",$GLOBALS['LANG']->lang_roomcp->voicelist_welcome);

			$compiled = array('group_voiced'=>'','group_moderators'=>'','user_voiced'=>'','user_moderators'=>'');
			foreach($GLOBALS['OUTPUT']->units as $unit_type=>$list){
				
				foreach($list as $speaking_group=>$group_data){
					
					$type = substr($unit_type,0,1) == 'g' ? 'group' : 'user';
					foreach($group_data as $unit_data){
						
						$compiled[$unit_type.'_'.$speaking_group] .= <<<EOV
&nbsp;&nbsp;<a href='./index.php?act=roomsettings{$GLOBALS['OUTPUT']->ses}&section=voicelist&rid={$GLOBALS['OUTPUT']->rid}&tochange={$unit_data['id']}&type=$type&perm=devoice'>{$unit_data['name']}</a><br />				
EOV;
					}
				}
				
			}
			
			foreach($compiled as $key=>$val){
				if(empty($val))
					$compiled[$key] = "<div style='text-align: center'><i>{$GLOBALS['LANG']->lang_roomcp->list_empty}</i></div>";
			}
			
			return	tpl_globals::header() .
				tpl_globals::global_styles_shared() .
				tpl_globals::inner_global_styles() .
				tpl_globals::form_styles() .
				tpl_roomcp::header() .
				<<<EOV
{$warning}
<div class='table_header'>&nbsp;{$GLOBALS['LANG']->lang_roomcp->speaker_perms}</div>
<div class='box_container'>
	<div class='infobox_inside'>{$intro_text}</div>
</div>
<br />

<div class='table_header'>&nbsp;{$GLOBALS['LANG']->lang_roomcp->voiced}</div>
<div class='box_container'>
	<div class='infobox_inside table_header_row' style='text-align: center'>
		{$GLOBALS['LANG']->lang_roomcp->users}
	</div>
	<div class='infobox_inside td2' style='text-align: left'>
		{$compiled['user_voiced']}
	</div>
	<div class='infobox_inside table_header_row' style='text-align: center'>
		{$GLOBALS['LANG']->lang_roomcp->groups}
	</div>
	<div class='infobox_inside td2' style='text-align: left'>
		{$compiled['group_voiced']}
	</div>
</div>
<br />

<div class='table_header'>&nbsp;{$GLOBALS['LANG']->lang_roomcp->moderators}</div>
<div class='box_container'>
	<div class='infobox_inside table_header_row' style='text-align: center'>
		{$GLOBALS['LANG']->lang_roomcp->users}
	</div>
	<div class='infobox_inside td2' style='text-align: left'>
		{$compiled['user_moderators']}
	</div>
	<div class='infobox_inside table_header_row' style='text-align: center'>
		{$GLOBALS['LANG']->lang_roomcp->groups}
	</div>
	<div class='infobox_inside td2' style='text-align: left'>
		{$compiled['group_moderators']}
	</div>
</div>
<br />

<form action='./index.php?act=roomsettings&section=voicelist&rid={$GLOBALS['OUTPUT']->rid}{$GLOBALS['OUTPUT']->ses}' method='post'>
<div class='table_header'>&nbsp;{$GLOBALS['LANG']->lang_roomcp->add_to_list}</div>
<table style='width: 100%;' cellspacing='1' cellpadding='5'>
	<tr>
		<td class='td2'>
EOV
.
				tpl_form::select('type',array($GLOBALS['LANG']->lang_roomcp->username=>'user',$GLOBALS['LANG']->lang_roomcp->groupname=>'group')) .
				<<<EOV
		</td>
		<td class='td2'>
EOV
.
				tpl_form::text_password_file('text','tochange') .
				<<<EOV
		</td>
	</tr>
	<tr>
		<td class='td2'>
			{$GLOBALS['LANG']->lang_roomcp->to_add_to}
		</td>
		<td class='td2'>
EOV
.
				tpl_form::select('perm',array($GLOBALS['LANG']->lang_roomcp->voiced=>'voice',$GLOBALS['LANG']->lang_roomcp->moderators=>'moderator')) .
				<<<EOV
		</td>
	</tr>
	<tr>
		<td colspan='2' style='text-align: center;' class='table_header_row'>
			<input type='submit' value='{$GLOBALS['LANG']->lang_formcommon->submit}' class='form_button_norm' onmouseout="this.className='form_button_norm'" onmouseover="this.className='form_button_over'">
		</td>
	</tr>
</table>
</form>
<br />
EOV
.
				tpl_roomcp::footer() .
				tpl_globals::footer();	
		}
		
		public static function mutelist(){
			
			$compiled = array('group'=>'','user'=>'');
			foreach($GLOBALS['OUTPUT']->units as $type=>$list){
				
				$rtype = substr($type,0,1) == 'g' ? 'group' : 'user';
				foreach($list as $unit_data){
					
					$compiled[$type] .= <<<EOV
&nbsp;&nbsp;<a href='./index.php?act=roomsettings{$GLOBALS['OUTPUT']->ses}&section=mutelist&rid={$GLOBALS['OUTPUT']->rid}&rem={$unit_data['id']}&type=$rtype'>{$unit_data['name']}</a><br />				
EOV;
				}
				
			}
			
			foreach($compiled as $key=>$val){
				if(empty($val))
					$compiled[$key] = "<div style='text-align: center'><i>{$GLOBALS['LANG']->lang_roomcp->list_empty}</i></div>";
			}
			
			return	tpl_globals::header() .
				tpl_globals::global_styles_shared() .
				tpl_globals::inner_global_styles() .
				tpl_globals::form_styles() .
				tpl_roomcp::header() .
				<<<EOV
<div class='table_header'>&nbsp;{$GLOBALS['LANG']->lang_roomcp->mutelist}</div>
<div class='box_container'>
	<div class='infobox_inside table_header_row'>{$GLOBALS['LANG']->lang_roomcp->mutelist_welcome}</div>
	<div class='infobox_inside table_header_row' style='text-align: center'>
		{$GLOBALS['LANG']->lang_roomcp->users}
	</div>
	<div class='infobox_inside td2' style='text-align: left'>
		{$compiled['user']}
	</div>
	<div class='infobox_inside table_header_row' style='text-align: center'>
		{$GLOBALS['LANG']->lang_roomcp->groups}
	</div>
	<div class='infobox_inside td2' style='text-align: left'>
		{$compiled['group']}
	</div>
</div>
<br />

<form action='./index.php?act=roomsettings&section=mutelist&rid={$GLOBALS['OUTPUT']->rid}{$GLOBALS['OUTPUT']->ses}' method='post'>
<div class='table_header'>&nbsp;{$GLOBALS['LANG']->lang_roomcp->mute_user_group}</div>
<table style='width: 100%;' cellspacing='1' cellpadding='5'>
	<tr>
		<td class='td2'>
EOV
.
				tpl_form::select('type',array($GLOBALS['LANG']->lang_roomcp->username=>'user',$GLOBALS['LANG']->lang_roomcp->groupname=>'group')) .
				<<<EOV
		</td>
		<td class='td2'>
EOV
.
				tpl_form::text_password_file('text','add') .
				<<<EOV
		</td>
	</tr>
	<tr>
		<td colspan='2' style='text-align: center;' class='table_header_row'>
			<input type='submit' value='{$GLOBALS['LANG']->lang_formcommon->submit}' class='form_button_norm' onmouseout="this.className='form_button_norm'" onmouseover="this.className='form_button_over'">
		</td>
	</tr>
</table>
</form>
<br />
EOV
.
				tpl_roomcp::footer() .
				tpl_globals::footer();	
		}
		
		public static function settings_form($form){
			
			$form_html = tpl_form::printform($form);
			$submit = tpl_form::submitbutton($GLOBALS['LANG']->lang_misc->submit);
			
			return	tpl_globals::header() .
				tpl_globals::global_styles_shared() .
				tpl_globals::inner_global_styles() .
				tpl_globals::form_styles2() .
				tpl_roomcp::header() .
				<<<EOV
<div style='width: 400px; margin: auto;'>
	<form action='./index.php?act=roomsettings{$GLOBALS['OUTPUT']->ses}&section=settings&rid={$GLOBALS['OUTPUT']->rid}' method='post' accept-charset='UTF-8'>
	{$form_html}
	<div class='form_container'>
		<div class='row end'>
			{$submit}
		</div>
	</div>
	</form>
</div>
EOV
.
				tpl_roomcp::footer() .
				tpl_globals::footer(false);
		}
	
		public static function main(){
			
			$GLOBALS['OUTPUT']->message = $GLOBALS['LANG']->lang_roomcp->roomcp_greeting;
			
			return	tpl_globals::header() .
				tpl_globals::global_styles_shared() .
				tpl_globals::inner_global_styles() .
				tpl_globals::form_styles() .
				tpl_roomcp::header() .
				tpl_roomcp::footer() .
				tpl_globals::footer();
		}
		
		public static function voicectrls(){
			
			$defaults = array('','');
			$defaults[($GLOBALS['OUTPUT']->current_mode ? 0 : 1)] = ' checked="true"';
			
			$desc = str_replace('<a>',"<a href='./index.php?act=roomsettings&section=voicelist&rid={$GLOBALS['OUTPUT']->rid}{$GLOBALS['OUTPUT']->ses}'>",$GLOBALS['LANG']->lang_roomcp->interview_speaking_mode_desc);
			
			return	tpl_globals::header() .
				tpl_globals::global_styles_shared() .
				tpl_globals::inner_global_styles() .
				tpl_globals::form_styles() .
				tpl_roomcp::header() .
				<<<EOV
<form action='./index.php?act=roomsettings{$GLOBALS['OUTPUT']->ses}&section=voicectrls&rid={$GLOBALS['OUTPUT']->rid}' method='post'>
<div class='table_header'>&nbsp;{$GLOBALS['LANG']->lang_roomcp->speaker_mode}</div>
<table style='width: 100%;' cellspacing='1' cellpadding='5'>
	<tr>
		<td class='table_header_row'>{$GLOBALS['LANG']->lang_roomcp->speaker_modes}</td>
	</tr>
	<tr>
		<td class='td2'>
			<input {$defaults[0]} type='radio' name='speaker_mode' value='1' id='am1' /> <label for='am1'>{$GLOBALS['LANG']->lang_roomcp->normal_speaking_mode}</label><br />
			<div class='instructions' style='margin-left: 25px;'>{$GLOBALS['LANG']->lang_roomcp->normal_speaking_mode_desc}</div>
		</td>
	</tr>
	<tr>
		<td class='td1'>
			<input {$defaults[1]} type='radio' name='speaker_mode' value='2' id='am2' /> <label for='am2'>{$GLOBALS['LANG']->lang_roomcp->interview_speaking_mode}</label><br />
			<div class='instructions' style='margin-left: 25px;'>{$desc}</div>
		</td>
	</tr>
	<tr>
		<td class='table_header_row' style='text-align: center'><input type='submit' value='{$GLOBALS['LANG']->lang_formcommon->submit}' class='form_button_norm' onmouseout="this.className='form_button_norm'" onmouseover="this.className='form_button_over'"></td>
	</tr>
</table>
</form>
EOV
.
				tpl_roomcp::footer() .
				tpl_globals::footer();
		}
	
		public static function access_mode(){
			
			$defaults = array('','','','');
			$defaults[$GLOBALS['OUTPUT']->default_mode] = ' checked="true"';
			
			$disp_pass = ($GLOBALS['OUTPUT']->default_mode == 2 ? '' : 'style="display: none"');
			
			$labels[0] = str_replace('<a>',"<a href='./index.php?act=roomsettings{$GLOBALS['OUTPUT']->ses}&section=accessperms&rid={$GLOBALS['OUTPUT']->rid}'>",$GLOBALS['LANG']->lang_roomcp->password_access_mode_desc);
			$labels[1] = str_replace('<a>',"<a href='./index.php?act=roomsettings{$GLOBALS['OUTPUT']->ses}&section=accessperms&rid={$GLOBALS['OUTPUT']->rid}'>",$GLOBALS['LANG']->lang_roomcp->permission_access_mode_desc);
			
			return	tpl_globals::header() .
				tpl_globals::global_styles_shared() .
				tpl_globals::inner_global_styles() .
				tpl_globals::form_styles() .
				tpl_roomcp::header() .
				<<<EOV
<form action='./index.php?act=roomsettings{$GLOBALS['OUTPUT']->ses}&section=access&rid={$GLOBALS['OUTPUT']->rid}' method='post'>
<div class='table_header'>&nbsp;{$GLOBALS['LANG']->lang_roomcp->access_mode}</div>
<table style='width: 100%;' cellspacing='1' cellpadding='5'>
	<tr>
		<td class='table_header_row'>{$GLOBALS['LANG']->lang_roomcp->access_modes}</td>
	</tr>
	<tr>
		<td class='td2'>
			<input {$defaults[1]} type='radio' name='access_mod' value='1' id='am1' onchange="if(this.checked) document.getElementById('pwd').style.display='none';" /> <label for='am1'>{$GLOBALS['LANG']->lang_roomcp->public_access_mode}</label><br />
			<div class='instructions' style='margin-left: 25px;'>{$GLOBALS['LANG']->lang_roomcp->public_access_mode_desc}</div>
		</td>
	</tr>
	<tr>
		<td class='td1'>
			<input {$defaults[2]} type='radio' name='access_mod' value='2' id='am2' onchange="if(this.checked) document.getElementById('pwd').style.display='block';" /> <label for='am1'>{$GLOBALS['LANG']->lang_roomcp->password_access_mode}</label><br />
			<div class='instructions' style='margin-left: 25px;'>{$labels[0]}</div>
			<div id='pwd' $disp_pass>
				<table style='width: 100%; background: transparent; border: 0px;' cellspacing='1' cellpadding='5'>
					<tr>
						<td width='20'>&nbsp;</td>
						<td width='75'>{$GLOBALS['LANG']->lang_roomcp->password}: </td>
						<td>
EOV
.
				tpl_form::text_password_file('text','password',$GLOBALS['OUTPUT']->default_pass) .
				<<<EOV
						</td>
					</tr>
				</table>
			</div>
		</td>
	</tr>
	<tr>
		<td class='td2'>
			<input {$defaults[3]} type='radio' name='access_mod' value='3' id='am3' onchange="if(this.checked) document.getElementById('pwd').style.display='none';" /> <label for='am1'>{$GLOBALS['LANG']->lang_roomcp->permission_access_mode}</label><br />
			<div class='instructions' style='margin-left: 25px;'>{$labels[1]}</div>
		</td>
	</tr>
	<tr>
		<td class='table_header_row' style='text-align: center'><input type='submit' value='{$GLOBALS['LANG']->lang_formcommon->submit}' class='form_button_norm' onmouseout="this.className='form_button_norm'" onmouseover="this.className='form_button_over'"></td>
	</tr>
</table>
</form>
EOV
.
				tpl_roomcp::footer() .
				tpl_globals::footer();
		}
		
		public static function access_perms(){
			
			$warning = ($GLOBALS['OUTPUT']->warning ? <<<EOV
<div class='table_header'>&nbsp;{$GLOBALS['LANG']->lang_roomcp->information}</div>
<div class='box_container'>
	<div class='infobox_inside'>{$GLOBALS['LANG']->lang_roomcp->accessperm_warning}</div>
</div>
<br />
EOV
: '');
			
			$compiled = array('group'=>'','user'=>'');
			foreach($GLOBALS['OUTPUT']->units as $type=>$list){
				
				$rtype = substr($type,0,1) == 'g' ? 'group' : 'user';
				foreach($list as $unit_data){
					
					$compiled[$type] .= <<<EOV
&nbsp;&nbsp;<a href='./index.php?act=roomsettings{$GLOBALS['OUTPUT']->ses}&section=accessperms&rid={$GLOBALS['OUTPUT']->rid}&rem={$unit_data['id']}&type=$rtype'>{$unit_data['name']}</a><br />				
EOV;
				}
				
			}
			
			foreach($compiled as $key=>$val){
				if(empty($val))
					$compiled[$key] = "<div style='text-align: center'><i>{$GLOBALS['LANG']->lang_roomcp->list_empty}</i></div>";
			}
			
			$intro = str_replace('<a>',"<a href='./index.php?act=roomsettings&section=access&rid={$GLOBALS['OUTPUT']->rid}{$GLOBALS['OUTPUT']->ses}'>",$GLOBALS['LANG']->lang_roomcp->accessperms_welcome);
			
			return	tpl_globals::header() .
				tpl_globals::global_styles_shared() .
				tpl_globals::inner_global_styles() .
				tpl_globals::form_styles() .
				tpl_roomcp::header() .
				<<<EOV
{$warning}
<div class='table_header'>&nbsp;{$GLOBALS['LANG']->lang_roomcp->access_perms}</div>
<div class='box_container'>
	<div class='infobox_inside'>{$intro}</div>
</div>
<br />

<div class='table_header'>&nbsp;{$GLOBALS['LANG']->lang_roomcp->access_perms}</div>
<div class='box_container'>
	<div class='infobox_inside table_header_row' style='text-align: center'>
		{$GLOBALS['LANG']->lang_roomcp->users}
	</div>
	<div class='infobox_inside td2' style='text-align: left'>
		{$compiled['user']}
	</div>
	<div class='infobox_inside table_header_row' style='text-align: center'>
		{$GLOBALS['LANG']->lang_roomcp->groups}
	</div>
	<div class='infobox_inside td2' style='text-align: left'>
		{$compiled['group']}
	</div>
</div>
<br />

<form action='./index.php?act=roomsettings&section=accessperms&rid={$GLOBALS['OUTPUT']->rid}{$GLOBALS['OUTPUT']->ses}' method='post'>
<div class='table_header'>&nbsp;{$GLOBALS['LANG']->lang_roomcp->grant_access}</div>
<table style='width: 100%;' cellspacing='1' cellpadding='5'>
	<tr>
		<td class='td2'>
EOV
.
				tpl_form::select('type',array($GLOBALS['LANG']->lang_roomcp->username=>'user',$GLOBALS['LANG']->lang_roomcp->groupname=>'group')) .
				<<<EOV
		</td>
		<td class='td2'>
EOV
.
				tpl_form::text_password_file('text','add') .
				<<<EOV
		</td>
	</tr>
	<tr>
		<td colspan='2' style='text-align: center;' class='table_header_row'>
			<input type='submit' value='{$GLOBALS['LANG']->lang_formcommon->submit}' class='form_button_norm' onmouseout="this.className='form_button_norm'" onmouseover="this.className='form_button_over'">
		</td>
	</tr>
</table>
</form>
<br />
EOV
.
				tpl_roomcp::footer() .
				tpl_globals::footer();	
		}
		
		public static function banlist(){
			
			$compiled = '';
			$class = 'td2';
			foreach($GLOBALS['OUTPUT']->bans as $unit_data){
				$compiled .= <<<EOV
<tr>
	<td class='$class'>{$unit_data['name']}</td>
	<td class='$class' width='150'>{$unit_data['end']}</td>
	<td class='$class' width='75'><a href='./index.php?act=roomsettings{$GLOBALS['OUTPUT']->ses}&section=banlist&rid={$GLOBALS['OUTPUT']->rid}&rem={$unit_data['uid']}'>{$GLOBALS['LANG']->lang_roomcp->unban}</td>
</tr>
EOV;
				$class = ($class == 'td2' ? 'td1' : 'td2');
			}
			
			if(empty($compiled))
				$compiled = "<tr><td colspan='3' class='td2' style='text-align: center'><i>{$GLOBALS['LANG']->lang_roomcp->list_empty}</i></td></tr>";
			
			return	tpl_globals::header() .
				tpl_globals::global_styles_shared() .
				tpl_globals::inner_global_styles() .
				tpl_globals::form_styles() .
				tpl_roomcp::header() .
				<<<EOV
<div class='table_header'>&nbsp;{$GLOBALS['LANG']->lang_roomcp->banlist}</div>
<table style='width: 100%;' cellspacing='1' cellpadding='5'>
	<tr>
		<td class='table_header_row'>{$GLOBALS['LANG']->lang_roomcp->username}</td>
		<td class='table_header_row' width='225' colspan='2'>{$GLOBALS['LANG']->lang_roomcp->remaining}</td>
	</tr>
	{$compiled}
</table>
<br />

<form action='./index.php?act=roomsettings&section=banlist&rid={$GLOBALS['OUTPUT']->rid}{$GLOBALS['OUTPUT']->ses}' method='post'>
<div class='table_header'>&nbsp;{$GLOBALS['LANG']->lang_roomcp->banuser}</div>
<table style='width: 100%;' cellspacing='1' cellpadding='5'>
	{$GLOBALS['OUTPUT']->ban_form}
	<tr>
		<td colspan='2' style='text-align: center;' class='table_header_row'>
			<input type='submit' value='{$GLOBALS['LANG']->lang_formcommon->submit}' class='form_button_norm' onmouseout="this.className='form_button_norm'" onmouseover="this.className='form_button_over'">
		</td>
	</tr>
</table>
</form>
<br />
EOV
.
				tpl_roomcp::footer() .
				tpl_globals::footer();	
		}
		
		public static function permissions(){
			
			$compiled = array('user'=>'','group'=>'');
			foreach($GLOBALS['OUTPUT']->units as $unit_type=>$subunit){
				
				foreach($subunit as $unit_data){
					$compiled[$unit_type] .= <<<EOV
&nbsp;&nbsp;<a href='./index.php?act=roomsettings{$GLOBALS['OUTPUT']->ses}&section=permissions&rid={$GLOBALS['OUTPUT']->rid}&edit={$unit_data['id']}&type=$unit_type'>{$unit_data['name']}</a><br />
EOV;
				}
			}
			
			foreach($compiled as $key=>$val){
				if(empty($val))
					$compiled[$key] = "<div style='text-align: center'><i>{$GLOBALS['LANG']->lang_roomcp->list_empty}</i></div>";
			}
					
			return	tpl_globals::header() .
				tpl_globals::global_styles_shared() .
				tpl_globals::inner_global_styles() .
				tpl_globals::form_styles() .
				tpl_roomcp::header() .
				<<<EOV
<div class='table_header'>&nbsp;{$GLOBALS['LANG']->lang_roomcp->user_group_permissions}</div>
<div class='box_container'>
	<div class='infobox_inside'>{$GLOBALS['LANG']->lang_roomcp->perms_welcome}</div>
</div>
<br />

<div class='table_header'>&nbsp;{$GLOBALS['LANG']->lang_roomcp->user_group_permissions}</div>
<div class='box_container'>
	<div class='infobox_inside table_header_row' style='text-align: center'>
		{$GLOBALS['LANG']->lang_roomcp->users}
	</div>
	<div class='infobox_inside td2' style='text-align: left'>
		{$compiled['user']}
	</div>
	<div class='infobox_inside table_header_row' style='text-align: center'>
		{$GLOBALS['LANG']->lang_roomcp->groups}
	</div>
	<div class='infobox_inside td2' style='text-align: left'>
		{$compiled['group']}
	</div>
</div>
<br />

<form action='./index.php?act=roomsettings&section=permissions&rid={$GLOBALS['OUTPUT']->rid}{$GLOBALS['OUTPUT']->ses}' method='post'>
<div class='table_header'>&nbsp;{$GLOBALS['LANG']->lang_roomcp->edit_user_or_group}</div>
<table style='width: 100%;' cellspacing='1' cellpadding='5'>
	<tr>
		<td class='td2'>
EOV
.
				tpl_form::select('type',array($GLOBALS['LANG']->lang_roomcp->username=>'user',$GLOBALS['LANG']->lang_roomcp->groupname=>'group')) .
				<<<EOV
		</td>
		<td class='td2'>
EOV
.
				tpl_form::text_password_file('text','add') .
				<<<EOV
		</td>
	</tr>
	<tr>
		<td colspan='2' style='text-align: center;' class='table_header_row'>
			<input type='submit' value='{$GLOBALS['LANG']->lang_formcommon->submit}' class='form_button_norm' onmouseout="this.className='form_button_norm'" onmouseover="this.className='form_button_over'">
		</td>
	</tr>
</table>
</form>
<br />
EOV
.
				tpl_roomcp::footer() .
				tpl_globals::footer();	
		}
		
		public static function permissions_form(){
			return	tpl_globals::header() .
				tpl_globals::global_styles_shared() .
				tpl_globals::inner_global_styles() .
				tpl_globals::form_styles() .
				tpl_roomcp::header() .
				<<<EOV
<form action='./index.php?act=roomsettings{$GLOBALS['OUTPUT']->ses}&section=permissions&rid={$GLOBALS['OUTPUT']->rid}&doedit={$GLOBALS['OUTPUT']->toedit}&type={$GLOBALS['OUTPUT']->edittype}' method='post'>
<div class='table_header'>&nbsp;{$GLOBALS['LANG']->lang_roomcp->user_group_permissions}</div>
	<table style='width: 100%;' cellspacing='1' cellpadding='5'>
EOV
.
				$GLOBALS['OUTPUT']->form .
				<<<EOV
		<tr>
			<td colspan='2' style='text-align: center;' class='table_header_row'>
				<input type='submit' value='{$GLOBALS['LANG']->lang_formcommon->submit}' class='form_button_norm' onmouseout="this.className='form_button_norm'" onmouseover="this.className='form_button_over'">
				<input type='button' value='{$GLOBALS['LANG']->lang_formcommon->cancel}' class='form_button_norm' onmouseout="this.className='form_button_norm'" onmouseover="this.className='form_button_over'" onclick="history.go(-1)">
			</td>
		</tr>
	</table>
</form>
EOV
.
				tpl_roomcp::footer() .
				tpl_globals::footer();
		}
		
		public static function logs(){
			
			if($GLOBALS['OUTPUT']->logging_on){
				$action = $GLOBALS['LANG']->lang_roomcp->turn_off;
				$state = -1;
			}else{
				$action = $GLOBALS['LANG']->lang_roomcp->turn_on;
				$state = 1;
			}
			
			return	tpl_globals::header() .
				tpl_globals::global_styles_shared() .
				tpl_globals::inner_global_styles() .
				tpl_globals::form_styles() .
				tpl_roomcp::header() .
				<<<EOV
<div class='table_header'>&nbsp;{$GLOBALS['LANG']->lang_roomcp->logs}</div>
<div class='box_container'>
	<div class='infobox_inside td2' style='text-align: center'>
		<a href='./index.php?act=roomsettings&section=logs&rid={$GLOBALS['OUTPUT']->rid}{$GLOBALS['OUTPUT']->ses}&state={$state}'>{$action}</a>
	</div>
</div>
<br />

<div class='table_header'>&nbsp;{$GLOBALS['LANG']->lang_roomcp->view_log}</div>
<div class='box_container'>
	<div class='infobox_inside td2' style='text-align: center'>
		<a href='./index.php?act=view_log&rid={$GLOBALS['OUTPUT']->rid}{$GLOBALS['OUTPUT']->ses}' target='_blank'>{$GLOBALS['LANG']->lang_roomcp->click_here_to_view_log}</a>
	</div>
</div>
<br />
EOV
.
				tpl_roomcp::footer() .
				tpl_globals::footer();	
		}
	
	}

?>